home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / ae_14.zip / AE0.PAS < prev    next >
Pascal/Delphi Source File  |  1991-03-12  |  15KB  |  267 lines

  1. unit AE0 ;
  2.  
  3. {$B-}
  4. {$I-}
  5. {$S+}
  6. {$V-}
  7.  
  8. {-----------------------------------------------------------------------------}
  9. { This unit contains the definitions of all constants, types                  }
  10. { and global variables                                                        }
  11. {-----------------------------------------------------------------------------}
  12.  
  13. interface
  14.  
  15. uses Dos ;
  16.  
  17. const MaxNrOfWorkspaces = 3 ;     { maximum number of workspaces }
  18.       WsBufSize         = 65534 ; { maximum size of workspace buffer }
  19.       OnePercent        = 655 ;   { = 1% of WsBufSize. Used in status line }
  20.       PasteBufSize      = 16384 ; { maximum size of paste buffer }
  21.       MaxMacroLength    = 100 ;   { maximum number of keystrokes in a macro }
  22.       NrOfMacros        = 10 ;    { number of macros }
  23.       MacroStackDepth   = 10 ;    { maximum size of macro stack }
  24.       PosStackDepth     = 10 ;    { maximum size of position stack }
  25.       Inactive          = 0 ;     { generally used value }
  26.       NrOfCursorTypes   = 4 ;     { number of cursor available types }
  27.       UnderLineCursor   = 1 ;     { cursor type }
  28.       HalfBlockCursor   = 2 ;     { cursor type }
  29.       BlockCursor       = 3 ;     { cursor type }
  30.       NoBlinkCursor     = 4 ;     { cursor type }
  31.       NrOfColorSettings = 8 ;     { size of ScreenColorArray }
  32.       LinesOnScreen     = 25 ;    { number of lines on a screen }
  33.       NrOfTextLines     = 24 ;    { = LinesOnScreen - 1 }
  34.       ColsOnScreen      = 80 ;    { number of columns on a screen }
  35.       CharsOnScreen     = 2000 ;  { number of characters on a screen (25*80) }
  36.       BkspKey           = 264 ;   { keynumber of Backspace key }
  37.       TabKey            = 265 ;   { keynumber of Tab key }
  38.       CtrlReturnKey     = 266 ;   { keynumber of Control-Return key }
  39.       ReturnKey         = 269 ;   { keynumber of Return (= Enter) key }
  40.       EscapeKey         = 283 ;   { keynumber of Escape key }
  41.       LF                = #10 ;   { line feed character (ASCII value 10) }
  42.       FF                = #12 ;   { form feed character (ASCII value 12) }
  43.       CR                = #13 ;   { carriage return character (ASCII value 13) }
  44.       EF                = #26 ;   { end-of-file character (ASCII value 26) }
  45.       ConfigFilename    = 'AE.CFG' ; { name of file containing setup settings }
  46.       Find              = 1 ;     { used to indicate search type }
  47.       FindAndReplace    = 2 ;     { used to indicate search type }
  48.       MaxFileListLength = 100 ;   { maximum number of files that can be in }
  49.                                   { a file list }
  50.  
  51.  
  52. type Position       = record Index       : word ;
  53.                              Linenr      : word ;
  54.                              Colnr       : word ;
  55.                              end ;
  56.                       { a position within a workspace buffer is stored in two }
  57.                       { ways: an index for the array (of type WsBuftype) and }
  58.                       { a line number plus column number }
  59.      WsBuftype      = array [1..WsBufSize] of char ;
  60.      WsBufPtr       = ^WsBuftype ;
  61.      Workspacetype  = record Name            : PathStr ;
  62.                              ChangesMade     : boolean ;
  63.                              LastTimeSaved   : array [1..4] of word ;
  64.                                                { hrs,mins,secs,1/100 secs }
  65.                              CurPos          : Position ;
  66.                                                { current position }
  67.                              Mark            : word ;
  68.                                                { index of block mark }
  69.                              FirstVisiblePos : Position ;
  70.                              FirstScreenCol  : word ;
  71.                              VirtualColnr    : word ;
  72.                                                { column nr that CurPos should }
  73.                                                { be on when moving through    }
  74.                                                { buffer vertivally            }
  75.                              Buffer          : WsBufPtr ;
  76.                              BufferSize      : word ;
  77.                                                { number of chars in buffer }
  78.                              PosStack        : array [1..PosStackDepth] of word;
  79.                                                { position stack }
  80.                              PosStackPointer : byte ;
  81.                              end ;
  82.      PasteBuftype   = array [1..PasteBufSize] of char ;
  83.      SetupBlock     = record CursorType      : byte ;
  84.                              Keyclick        : boolean ;
  85.                              ScreenColors    : byte ;
  86.                              SoundBell       : boolean ;
  87.                              PageLength      : word ;
  88.                              LeftMargin      : word ;
  89.                              TopMargin       : word ;
  90.                              PrintPageNrs    : boolean ;
  91.                              WordWrapLength  : word ;
  92.                              TabSpacing      : word ;
  93.                              AutoIndent      : boolean ;
  94.                              DotsForSpaces   : boolean ;
  95.                              InsertMode      : boolean ;
  96.                              SaveOnExit      : boolean ;
  97.                              SaveInterval    : word ;
  98.                              MakeBAKfile     : boolean ;
  99.                              end ;
  100.      MacroBlock        = record Contents      : array [1..NrOfMacros,
  101.                                                        1..MaxMacroLength]
  102.                                                        of word ;
  103.                                 Length        : array [1..NrOfMacros] of word ;
  104.                                 end ;
  105.      ConfigBlock       = record Setup : SetupBlock ;
  106.                                 Macro : MacroBlock ;
  107.                                 end ;
  108.      MacroStackElement = record Macronr : byte ;
  109.                                 Index   : byte ;
  110.                                 end ;
  111.      { the following types are defined because most information is written }
  112.      { directly into video memory }
  113.      ScreenArray    = array[1..LinesOnScreen,1..ColsOnScreen] of word ;
  114.      ScreenPtr      = ^ScreenArray ;
  115.      ScreenBlock    = array[1..CharsOnScreen] of word ;
  116.      ScreenBlockPtr = ^ScreenBlock ;
  117.      ScreenElement  = record Contents  : char ;
  118.                              Attribute : byte ;
  119.                              end ;
  120.      ColorSetting   = record NormAttr   : byte ;
  121.                              BlockAttr  : byte ;
  122.                              StatusAttr : byte ;
  123.                              CursorAttr : byte ;
  124.                              end ;
  125.                       { contains the attributes used on the screen: NormAttr }
  126.                       { for normal characters, BlockAttr for characters      }
  127.                       { within the selected block, StatusAttr for characters }
  128.                       { on the status line and in messages                   }
  129.      FilenameStr    = string[12] ;
  130.                       { contains the name of a file plus extension }
  131.  
  132.  
  133. const DefaultSetup : { default setup, used if no setup file is found }
  134.                      { in the current directory }
  135.                      SetupBlock = (
  136.                             CursorType      : UnderLineCursor ;
  137.                             Keyclick        : False ;
  138.                             ScreenColors    : 3 ;
  139.                             SoundBell       : True ;
  140.                             PageLength      : Inactive ;
  141.                             LeftMargin      : 0 ;
  142.                             TopMargin       : 0 ;
  143.                             PrintPageNrs    : False ;
  144.                             WordWrapLength  : Inactive ;
  145.                             TabSpacing      : 0 ;
  146.                             AutoIndent      : True ;
  147.                             DotsForSpaces   : False ;
  148.                             InsertMode      : True ;
  149.                             SaveOnExit      : False ;
  150.                             SaveInterval